/**
 * 开始工作
 * @type {HTMLElement | null}
 */


var runWork = function() {
  var sourceVul = document.getElementById('sourceVul').value;
  var resultVulTT = document.getElementById('resultVul');
  if (!sourceVul) {
    return;
  }
  var TmpList = [];
  var strLen = sourceVul.length;
  document.getElementById('sourceNum').innerText = strLen;
  for (var i = 0; i < strLen; i += 1) {
    var t = sourceVul[i].replace(/\s+/g, '');
    t = t.replace(/\r\n+/g, '');
    t = t.replace(/\n+/g, '');
    t = t.replace(/\r+/g, '');
    if (t && TmpList.indexOf(t) === -1) {
      TmpList.push(sourceVul[i]);
    }
  }
  TmpList.sort();
  var TmpLen = TmpList.length;
  document.getElementById('resultNum').innerText = TmpLen;
  resultVulTT.value = TmpList.join('');
};

var runEmpty = function() {
  document.getElementById('sourceVul').value = '';
  document.getElementById('resultVul').value = '';
  document.getElementById('sourceNum').innerText = '';
  document.getElementById('resultNum').innerText = '';
};